package cn.sytton.taffe.auth.service.impl;

import cn.sytton.taffe.auth.service.IProfileService;
import cn.sytton.taffe.framework.security.entity.LoginUser;
import cn.sytton.taffe.framework.security.jwt.JwtFactory;
import cn.sytton.taffe.framework.util.ServletUtil;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * Profile服务层
 *
 * @author skyrock
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class ProfileService implements IProfileService {

    @Resource
    private JwtFactory jwtFactory;

    @Override
    public LoginUser profile() {
        return jwtFactory.getLoginUser(ServletUtil.getRequest());
    }
}
